from numpy import double

from stock_control.Strategy import AhYiJia
from stock_control.Strategy import HighTop


# 生成所有策略的对象，初始化资金
def init_strategy_obj_and_fund(strategy, money, num):
    # 将所有资金等分取整，最后剩下的都给最后一个策略
    eachfund = double(money) // int(num)
    # 策略：ah溢价
    ah_obj = AhYiJia(0, eachfund)
    strategy.append(ah_obj)
    # 策略：历史新高
    high_top_obj = HighTop(1, double(money)-eachfund * (int(num) - 1))
    strategy.append(high_top_obj)
